

function addSensorbitCod(Blockly) {




    //红外循迹传感器模块
    Blockly.Python.microbit_track = function(block) {
        var dropdown_track = this.getFieldValue('track');
        Blockly.Python.definitions_['import_microbit'] = 'from microbit import *';
        Blockly.Python.definitions_['import_music'] = 'from sensor import infrared_trace';
        var code = "infrared_trace.is_black("+ dropdown_track +")";
        return [code];
      }
      
    return Blockly;
}

module.exports = addSensorbitCod;

